package anotationDemo;

import java.lang.reflect.Field;

public class Demo2 {
	@Ano2(id = 2, name = "goooo")
	public int g;
	@Ano2(id = 7)
	private int t;

	public static void t1(Class<?> clazz) {
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			System.out.println(field);
			Ano2 ano2 = field.getAnnotation(Ano2.class);
			if (ano2 != null) {
				System.out.println(ano2.id() + ano2.name());
			}
		}

	}

	public static void main(String[] args) {
		t1(Demo2.class);
	}

}
